﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace SatisfiableChecker
{
    public class ArrayListStack
    {
        private ArrayList store;        
        public const int MAX_CAPACITY = 5;

        public ArrayListStack()
        {
            this.store = new ArrayList();            
        }

        public void PushInt(Int32 value_ren)
        {
            SatisfiableHelper.Check(this.store.Count == MAX_CAPACITY);
            if (this.store.Count == MAX_CAPACITY)
            {
                Console.WriteLine("Stack full");
                return;
            }
            
            this.store.Add(value_ren);            
        }

        public Int32 PopInt()
        {
            if (this.store.Count == 0)
            {
                Console.WriteLine("Stack empty");
                return -1;
            }                
            int result = (int)this.store[0];
            this.store.RemoveAt(0);
            return result;
        }
    }
}
